package com.example.userservice.common;

import com.example.userservice.entity.dto.UserDto;

public class UserContext {
    private static final ThreadLocal<UserDto> userHolder = new ThreadLocal<>();

    public static void set(UserDto user) {
        userHolder.set(user);
    }

    public static UserDto get() {
        return userHolder.get();
    }

    public static void clear() {
        userHolder.remove();
    }
}
